static void writeOffset(ZoneOffset offset,DataOutput out) throws IOException {
  final int offsetSecs=offset.getTotalSeconds();
  int offsetByte=offsetSecs % 900 == 0 ? offsetSecs / 900 : 127;
  out.writeByte(offsetByte);
  if (offsetByte == 127) {
    out.writeInt(offsetSecs);
  }
}

static void writeOffset ( ZoneOffset offset , DataOutput out ) throws IOException { final int offsetSecs = offset . getTotalSeconds ( ) ; int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127 ; out . writeByte ( offsetByte ) ; if ( offsetByte == 127 ) { out . writeInt ( offsetSecs ) ; } }
writes the state the zoneoffset to the stream .
