You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InterfaceEndRecord.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.hssf.record;
  16. import java.util.Map;
  17. import java.util.function.Supplier;
  18. import org.apache.poi.util.LittleEndianOutput;
  19. import org.apache.poi.util.RecordFormatException;
  20. /**
  21. * Shows where the Interface Records ends (MMS)
  22. */
  23. public final class InterfaceEndRecord extends StandardRecord {
  24. public static final short sid = 0x00E2;
  25. public static final InterfaceEndRecord instance = new InterfaceEndRecord();
  26. private InterfaceEndRecord() {
  27. // enforce singleton
  28. }
  29. public static org.apache.poi.hssf.record.Record create(RecordInputStream in) {
  30. switch (in.remaining()) {
  31. case 0:
  32. return instance;
  33. case 2:
  34. return new InterfaceHdrRecord(in);
  35. }
  36. throw new RecordFormatException("Invalid record data size: " + in.remaining());
  37. }
  38. public void serialize(LittleEndianOutput out) {
  39. // no instance data
  40. }
  41. protected int getDataSize() {
  42. return 0;
  43. }
  44. public short getSid() {
  45. return sid;
  46. }
  47. @Override
  48. public InterfaceEndRecord copy() {
  49. return instance;
  50. }
  51. @Override
  52. public HSSFRecordTypes getGenericRecordType() {
  53. return HSSFRecordTypes.INTERFACE_END;
  54. }
  55. @Override
  56. public Map<String, Supplier<?>> getGenericProperties() {
  57. return null;
  58. }
  59. }